<?php
	// Database configuration
	$db_server   = '201.202.252.88';
	$db_name     = 'expediente_svn';
	$db_username = 'root';
	$db_password = 'p4pwud59';

	$id = $_POST['patient_id'];

	$dbconnection = @mysql_connect($db_server,$db_username,$db_password) or die("Error conectando a la BBDD");

	//echo "Conectado correctamente"."<BR/><BR/>";

	$db = mysql_select_db($db_name, $dbconnection) or die ($dbname . " Base de datos no encontrada."); 
	//echo "Base de datos " . $db_name . " seleccionada"."<BR/><BR/>";
		
	$result = mysql_query("SELECT * from rcs_persona_fisica where NUM_IDENTIFICACION='".$id."'") or die('Could not query');
    $json = array();

	$total_records = mysql_num_rows($result);

	if($total_records >= 1){
	  while ($row = mysql_fetch_array($result, MYSQL_ASSOC)){
		$json[] = $row;
	  }
	}

    mysql_close($dbconnection);
	
	echo '' . json_encode($json) . '';
?>
